package tt.dz.egobus.servicemanager.business.task;

import tt.dz.egobus.bean.BusinessStatus;
import tt.dz.egobus.servicemanager.service.BusinessCacheService;

/**
 * @author Anson
 * @date 17-8-9
 * @name 异步处理业务流畅状态
 * @since 1.0.6
 */
public class BusinessStatusChange implements Runnable {

    private final String businessId;

    private final BusinessStatus status;

    private final BusinessCacheService businessCacheService;

    public BusinessStatusChange(String businessId, BusinessStatus status,
                                BusinessCacheService businessCacheService) {
        this.businessId = businessId;
        this.status = status;
        this.businessCacheService = businessCacheService;
    }


    @Override
    public void run() {
        this.businessCacheService.updateStatus(this.businessId, this.status);
    }
}
